package com.YCH.model.behavior.pojos;

import com.YCH.model.annotation.IdEncrypt;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.apache.ibatis.type.Alias;

import java.util.Date;

@Data
public class TbCollectionBehavior {
    private Long id;
    @IdEncrypt
    private Long userId;
    @IdEncrypt
    private Long articleId;
    private Short operation;
    private Short type;
    private Date creatTime;

    // 定义收藏内容类型的枚举
    @Alias("TbCollectionEnumType")
    public enum CollectionContentType{
        ARTICLE((short)0),DYNAMIC((short)1);
        short code;
        CollectionContentType(short code){
            this.code = code;
        }
        public short getCode(){
            return this.code;
        }
    }

    //定义点收藏作的方式，收藏还是取消收藏
    @Alias("TbCollectedBehaviorEnumOperation")
    public enum Operation{
        COLLECTED((short)0),CANCEL((short)1);
        short code;
        Operation(short code){
            this.code = code;
        }
        public short getCode(){
            return this.code;
        }
    }
} 